//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CEffectPool10.h>
///	@path	~/src/graphics/dx10/
///	@date	2008/12/20
///	@desc	.

#pragma once

#include "xeres.h"

#include "graphics/IEffectPool.h"
#include "graphics/dx10/CDevice10.h"

#include <d3d10effect.h>

namespace xeres {

	/*!
		\class	CEffectPool10
		\brief	Effect pool implementation in DX9.
	*/
	class CEffectPool10 : public IEffectPool
	{
	public:

		/// \ctor
		CEffectPool10( ID3D10EffectPool * pool );

		/// \dtor
		virtual ~CEffectPool10( void );

		DECL_IOBJECT_CLASS( CEffectPool10 , IEffectPool );

	public:

	//@ interface

		/*!
			\brief		Get effect pool's master effect.
		*/
		virtual RefPass<IEffect> GetMasterEffect( void );

		/*! 
			\brief		Get effect pool interface.
		*/
		virtual IUnknown * GetEffectPoolInterface( void );

	//@ local

		/*!
			\brief		Get effect pool interface.
		*/
		ID3D10EffectPool * GetEffectPool( void ) const { return m_pEffectPool; }

		/*!
			\brief		Get effect pool interface.
		*/
		ID3D10EffectPool * operator -> ( void ) const { return m_pEffectPool; }

	private:

	//@ data
		
		ID3D10EffectPool *		m_pEffectPool;
		Ref<IEffect>			m_effect;

	};

} // namespace xeres
